<template>
	<view>
		<cu-custom bgColor="bg-white" :isBack="false">
			<block slot="back">返回</block>
			<block slot="content">我的订单</block>
		</cu-custom>
		
		<view v-if="!$com.isbool(list)">
			<view class="mar5 pad10 tac bdda c12 bcaf3">
				暂无订单数据
			</view>
		</view>
		
		<view class="padlr3" >
			<view class="mart5 bcf round2 shadow-blur" :data-id="item.id" @click="$win.goto('/pages/wuliu/orderinfo/orderinfo',$event)" v-for="item,index in list" v-key="index">
				<view class="flrc pad5">
					<view class="flex1">{{item.sn}}</view>
					<view>{{$com.str2time(item.createAt)}}</view>
				</view>
				<view class="bdtso">
					<view class="flrc pad5">
						<view class="">货物描述：</view>
						<view class="flex1">{{item.title}}</view>
					</view>
					<view class="flrc pad5">
						<view class="">发货地址：</view>
						<view class="flex1">{{item.startAddress}}</view>
					</view>
					<view class="flrc pad5">
						<view class="">收货地址：</view>
						<view class="flex1">{{item.endAddress}}</view>
					</view>
					<view class="flrc pad5">
						<view class="">联系人：</view>
						<view class="flex1">{{item.contact}}</view>
					</view>
					<view class="flrc pad5">
						<view class="">联系人电话：</view>
						<view class="flex1">{{item.phone}}</view>
					</view>
				</view>
				<view class="flrc pad5 bdtso">
					<view>订单状态：</view>
					<view class="flex1">
					{{item.status == 0?'待处理':''}}
					{{item.status == 1?'已处理':''}}
					{{item.status == 2?'已取消':''}}
					{{item.status == 9?'完成':''}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from '../../../static/js/api.js'
	import com from '../../../static/js/com.js'
	import win from '../../../static/js/win.js'
	import list from '../../../static/js/list.js'
	export default {
		data() {
			return {
				list:[]
			}
		},
		methods: {
			
		},
		onShow(){
			let _this = this
			list.setUrl("/api/wuliuOrders")
			.setCbFunc(function(res){
				console.log(res)
				uni.stopPullDownRefresh()
				_this.list = res
			}).reload()
		},
		onPullDownRefresh() {
			list.reload()
		},
		onReachBottom(){
			list.getList()
		}
	}
</script>

<style>

</style>
